#ifndef COMPUTING_PERCEPTION_LIDAR_LSHAPE_H
#define COMPUTING_PERCEPTION_LIDAR_LSHAPE_H

#include <limits>
#include <vector>
#include <memory>
#include <iostream>
#include "common/algorithm_type/lidar_cell_objs_type.h"
#include "common/algorithm_type/lidar_cell_type.h"
namespace perception
{
    namespace algorithm
    {
        struct point
        {
            float x;
            float y;
        };

        class LShape
        {
        public:
            /// The construct methord of the class Classify.
            LShape();
            ~LShape();
            float Compute(std::vector<data_cell> &cells);

        private:
            float rad = 0;
            float drad = 10;   // 度 航向每一次的变化
            float th_rad = 5; // 正负阈值
            // const double deg2rad = M_PI_2 / 90.0;

            std::vector<point> GetMaxMinXY(std::vector<data_cell> &lidar_objects);
            std::vector<point> GetMaxCorner(std::vector<point> &f);
            std::vector<float> GetABC(point &a, point &b);
            bool GetCornerPoints(std::vector<data_cell> &cells, point &max_y, point &min_y,point& result);
            float GetHeading(point &max_y, point &min_y, point &min_x);
            
        };
    } // namespace perception
} // namespace avos
#endif // COMPUTING_PERCEPTION_LIDAR_PROCESS_CLASSIFY_CLASSIFY_H